#include "widget.h"
#include "ui_widget.h"
#include <QPushButton>
#include <QHBoxLayout>
#include <QVBoxLayout>

Widget::Widget(QWidget *parent)
    : QWidget(parent)
    , ui(new Ui::Widget)
{
    ui->setupUi(this);

    QPushButton* button1 = new QPushButton("按钮1");
    QPushButton* button2 = new QPushButton("按钮2");
    QPushButton* button3 = new QPushButton("按钮3");
    QPushButton* button4 = new QPushButton("按钮4");

    QHBoxLayout* Hlayout = new QHBoxLayout();
    Hlayout->addWidget(button3);
    Hlayout->addWidget(button4);
    QVBoxLayout* Vlayout = new QVBoxLayout();
    Vlayout->addWidget(button1);
    Vlayout->addWidget(button2);
    Vlayout->addLayout(Hlayout);

    this->setLayout(Hlayout);
    this->setLayout(Vlayout);
}

Widget::~Widget()
{
    delete ui;
}

